package org.advanced.io;

import java.io.FileInputStream;

/**
 * @author John.zhang
 * @version Id: ByteRead, v 1.0 2020/12/14 14:24 ZhiYong Exp $
 */
public class ByteRead {

    public static void main(String[] args) {
        try (FileInputStream fileInputStream = new FileInputStream("C:/data/io/io02.txt")) {
            int len = 0;
            byte[] buffer = new byte[1024];
            while ((len = fileInputStream.read(buffer)) != -1) {
                System.out.println(new String(buffer, 0, len));
            }
        } catch (Exception e) {

        }
    }

}
